package com.lindroy.androidanimation

import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.ArrayAdapter
import com.lindroy.androidanimation.extension.launchActivity
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
    private val contents = listOf("帧动画","视图动画","属性动画")

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        lvContents.adapter = ArrayAdapter(this, android.R.layout.simple_list_item_1, contents)
        lvContents.setOnItemClickListener { parent, view, position, id ->
            when (position) {
                0 -> launchActivity<FrameAnimActivity>()
                1 -> launchActivity<TweenAnimActivity>()
                2 -> launchActivity<PropertyAnimActivity>()
            }
        }
    }



}